From c7e8f628aa215caaa999f06d7fccb910fd5cc099 Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Sun, 15 Feb 2026 16:58:17 -0800 Subject: fix custodial bitcoin sends --- src/routes/(app)/send/bitcoin/[address]/+layout.server.ts | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'src/routes/(app)/send/bitcoin/[address]/+layout.server.ts') diff --git a/src/routes/(app)/send/bitcoin/[address]/+layout.server.ts b/src/routes/(app)/send/bitcoin/[address]/+layout.server.ts index d8df1986..6acb36b6 100644 --- a/src/routes/(app)/send/bitcoin/[address]/+layout.server.ts +++ b/src/routes/(app)/send/bitcoin/[address]/+layout.server.ts @@ -15,10 +15,13 @@ export async function load({ cookies, params, parent }) { } if (invoice) { - const recipient = await get(`/users/${invoice.uid}`); - let r = `/pay/${recipient.username}`; - if (amount) r += `/${amount}`; - if (recipient?.id !== user.id) redirect(307, r); + const isVault = invoice.account?.pubkey || invoice.account?.seed; + if (isVault) { + // Vault account — stay on /send/bitcoin for on-chain send + } else { + // Custodial account — send internally via the original invoice + if (invoice.uid !== user.id) redirect(307, `/send/invoice/${invoice.id}`); + } } return { balance }; -- cgit v1.2.3